package com.ylfstu;

/**
 * @author:Joy_Yang
 * @date:2022/9/28
 * @version:1.0
 */
public class MathMethod {
    public static void main(String[] args) {
        int abs = Math.abs(9);

        double pow = Math.pow(2, 4);
        //3.向上取整，返回>=该参数的最小整数，会转成一个double
        double ceil = Math.ceil(-3.00001);
        //4.floor向下取整，返回<=该参数的最大整数，会转成一个double
        double floor = Math.floor(4.0001);
        //5.round 四舍五入
        long round = Math.round(-5.0001);
        //6.sqrt 开方
        double sqrt = Math.sqrt(9.0);
        //7. random 返回 [0,1) 之间的一个小数
        double random = Math.random();
        // a <= X <= b
        // int(a + Math.random() * (b - a + 1))
        for (int i = 0; i < 10; i++) {
            System.out.println((int)(45 + Math.random() * (65 - 45 + 1)));
        }
        //Max   Min

        Double n1 = 3.14;
        Double n2 = 7.95;
        System.out.println(n2 - n1);

    }
}
